#! /bin/bash
export LANG=zh_CN.UTF-8
HIVE_HOME=/usr/bin/hive


${HIVE_HOME} -S -e"
-- mysql 删表
DROP TABLE if exists edu_olap_online.time_school;
DROP TABLE if exists edu_olap_online.time_ofline_school;
DROP TABLE if exists edu_olap_online.time_ofline_subject;
DROP TABLE if exists edu_olap_online.time_ofline_school_subject;
DROP TABLE if exists edu_olap_online.time_ofline_source;
DROP TABLE if exists edu_olap_online.time_ofline_dept;
DROP TABLE if exists edu_olap_online.time_intention_signup_ratio;
DROP TABLE if exists edu_olap_online.time_clue_signup_ratio;

-- presto CTAS
create table mysql.edu_olap_online.time_school as(
select * from hive.edu_online_ads.time_school
);

create table mysql.edu_olap_online.time_ofline_school as(
select * from hive.edu_online_ads.time_ofline_school
);

create table mysql.edu_olap_online.time_ofline_subject as(
select * from hive.edu_online_ads.time_ofline_subject
);

create table mysql.edu_olap_online.time_ofline_school_subject as(
select * from hive.edu_online_ads.time_ofline_school_subject
);

create table mysql.edu_olap_online.time_ofline_source as(
select * from hive.edu_online_ads.time_ofline_source
);

create table mysql.edu_olap_online.time_ofline_dept as(
select * from hive.edu_online_ads.time_ofline_dept
);

create table mysql.edu_olap_online.time_intention_signup_ratio as(
select * from hive.edu_online_ads.time_intention_signup_ratio
);

create table mysql.edu_olap_online.time_clue_signup_ratio as(
select * from hive.edu_online_ads.time_clue_signup_ratio
);
"